﻿'*******************************************************************************************
'* Copyright Brügmann Software GmbH, Papenburg
'* Author: Björn Kremer
'* Contact: codeplex<at>patorg.de
'* 
'* VB.CMIS is a VB.NET implementation of the Content Management Interoperability Services (CMIS) standard
'*
'* This file is part of VB.CMIS.
'* 
'* VB.CMIS is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License as published by
'* the Free Software Foundation, either version 3 of the License, or
'* (at your option) any later version.
'* 
'* VB.CMIS is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'* GNU Lesser General Public License for more details.
'* 
'* You should have received a copy of the GNU Lesser General Public License
'* along with VB.CMIS. If not, see <http://www.gnu.org/licenses/>.
'*******************************************************************************************
Imports System.ServiceModel
Imports System.ServiceModel.Web
Imports System.ServiceModel.Syndication
Imports CMISObjectModel.Constants
Imports CMISObjectModel.CMISObjects
Namespace Services.Interfaces
   ''' <summary>
   ''' This is the interface for the WCF Service. It describes all CMIS functions for the cmis standard.
   ''' </summary>
   ''' <remarks></remarks>
   <ServiceContract(SessionMode:=ServiceModel.SessionMode.NotAllowed)>
   <XmlSerializerFormat()>
   Public Interface ICMISMainService

      ''' <summary>
      ''' Returns the CMIS service-documents for all available repositories
      ''' </summary>
      ''' <returns></returns>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetServiceDocument)>
      Function GetServiceDocuments() As AtomPub10ServiceDocumentFormatter
      ''' <summary>
      ''' Returns the CMIS service-document for the specified repository
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <returns></returns>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetServiceDocumentById)>
      Function GetServiceDocument(repositoryId As String) As AtomPub10ServiceDocumentFormatter

#Region "Feeds"

#Region "Object Parents Feed"
      ''' <summary>
      ''' Returns the parent folders for the specified object
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="renditionFilter"></param>
      ''' <param name="includeRelativePathSegment"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed 
      ''' This feed contains a set of atom entries for each parent of the object that MUST contain: 
      ''' cmisra:object inside atom:entry 
      ''' cmisra:relativePathSegment 
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetObjectParents)>
      Function GetObjectParents(repositoryId As String, id As String, filter As String, includeAllowableActions As String, includeRelationships As String, renditionFilter As String, includeRelativePathSegment As String) As Atom10FeedFormatter
#End Region

#Region "Changes"
      ''' <summary>
      ''' Returns a list of content changes
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="filter"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="includeACL"></param>
      ''' <param name="includePolicyIds"></param>
      ''' <param name="includeProperties"></param>
      ''' <param name="changeLogToken"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed 
      ''' The following CMIS Atom extension element MUST be included inside the atom entries: 
      ''' cmisra:object inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetContentChanges)>
      Function GetContentChanges(repositoryId As String, filter As String, maxItems As String, includeACL As String, includePolicyIds As String, includeProperties As String, changeLogToken As String) As Atom10FeedFormatter
#End Region

#Region "Folder Descendants"
      ''' <summary>
      ''' Returns the descendant objects contained in the specified folder or any of its child-folders.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <param name="depth"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="renditionFilter"></param>
      ''' <param name="includePathSegment"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed 
      ''' The following CMIS Atom extension element MUST be included inside the atom entries: 
      ''' cmisra:object inside atom:entry 
      ''' cmisra:pathSegment inside atom:entry 
      ''' cmisra:children inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems</remarks>
      <OperationContract()>
     <WebGet(UriTemplate:=ServiceURIs.GetDescendants)>
      Function GetDescendants(repositoryId As String, id As String, filter As String, depth As String, includeAllowableActions As String, includeRelationships As String, renditionFilter As String, includePathSegment As String) As Atom10FeedFormatter
      ''' <summary>
      ''' 
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="continueOnFailure"></param>
      ''' <param name="unfileObjects"></param>
      ''' <remarks>
      ''' Status Code:
      ''' 200 OK if successful.  Body contains entity describing the status
      ''' 202 Accepted, if accepted but deletion not yet taking place
      ''' 204 No Content, if successful with no content
      ''' 403 Forbidden, if permission is denied
      ''' 401 Unauthorized, if not authenticated
      ''' 500 Internal Server Error.  The body SHOULD contain an entity describing the status
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="DELETE", UriTemplate:=ServiceURIs.DeleteTree)>
      Sub DeleteTree(repositoryId As String, id As String, allVersions As String, continueOnFailure As String, unfileObjects As String)
#End Region

#Region "Folder Tree"
      ''' <summary>
      ''' Returns the descendant folders contained in the specified folder
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <param name="depth"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="renditionFilter"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom +xml;type=feed
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:object inside atom:entry
      ''' cmisra:pathSegment inside atom:entry
      ''' cmisra:children inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
     <WebGet(UriTemplate:=ServiceURIs.GetFolderTree)>
      Function GetFolderTree(repositoryId As String, id As String, filter As String, depth As String, includeAllowableActions As String, includeRelationships As String, renditionFilter As String) As Atom10FeedFormatter
#End Region

#Region "AllVersions Feed"

      ''' <summary>
      ''' Returns all Documents in the specified version series.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' This feed contains a set of atom entries for each version in the version series
      ''' cmisra:object inside atom:entry
      ''' cmisra:children inside atom:entry if atom:entry represents a CMIS Folder
      ''' </remarks>
      <OperationContract()>
       <WebGet(UriTemplate:=ServiceURIs.GetAllVersions)>
      Function GetAllVersions(repositoryId As String, id As String, filter As String, includeAllowableActions As String) As Atom10FeedFormatter
      ''' <summary>
      ''' Deletes all Documents in the specified version series.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <remarks>
      ''' Success HTTP code: 204
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="DELETE", UriTemplate:=ServiceURIs.DeleteAllVersions)>
      Sub DeleteAllVersions(repositoryId As String, id As String)

#End Region

#Region "Type Descendants Feed"
      ''' <summary>
      ''' Returns the descendant object-types under the specified type.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="includePropertyDefinitions"></param>
      ''' <param name="depth"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' Media Type: application/atom+xml;type=feed
      ''' </remarks>
      <OperationContract()>
    <WebGet(UriTemplate:=ServiceURIs.GetTypeDescendants)>
      Function GetTypeDescendants(repositoryId As String, id As String, includePropertyDefinitions As String, depth As String) As Atom10FeedFormatter
#End Region

#End Region


#Region "Resources"

#Region "Type Entry"
      ''' <summary>
      ''' Returns the type-definition of the specified type
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=entry 
      ''' Atom-Extensions: cmisra:type
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetTypeDefinition)>
      Function GetTypeDefinition(repositoryId As String, id As String) As Atom10ItemFormatter
#End Region

#Region "Document Entry/Document Private Working Copy (PWC) Entry/Folder Entry/Relationship Entry/Policy Entry"

      ''' <summary>
      ''' Returns the CMIS object with the specified id.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="pwc"></param>
      ''' <param name="returnVersion"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="includePolicyIds"></param>
      ''' <param name="includeACL"></param>
      ''' <param name="filter"></param>
      ''' <param name="renditionFilter"></param>
      ''' <returns></returns>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetObject)>
      Function GetObject(repositoryId As String, id As String, pwc As String, returnVersion As String, includeAllowableActions As String, includeRelationships As String, includePolicyIds As String, includeACL As String, filter As String, renditionFilter As String) As Atom10ItemFormatter  'Media Type: application/atom+xml;type=entry - Atom-Extensions: cmisra:object

      ''' <summary>
      ''' Updates the submitted cmis-object
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="major"></param>
      ''' <param name="checkin"></param>
      ''' <param name="checkinComment"></param>
      ''' <param name="data"></param>
      ''' <returns></returns>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebInvoke(Method:="PUT", UriTemplate:=ServiceURIs.UpdateProperties, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function UpdateProperties(repositoryId As String, id As String, major As String, checkin As String, checkinComment As String, data As Xml.XmlDocument) As Atom10ItemFormatter  'Response Body containing the updated atom entry

      ''' <summary>
      ''' Removes the submitted document
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="allVersions"></param>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebInvoke(Method:="DELETE", UriTemplate:=ServiceURIs.DeleteObject)>
      Sub DeleteObject(repositoryId As String, id As String, allVersions As String) ' Success HTTP code: 204

#End Region

#Region "Content Stream"
      ''' <summary>
      ''' Returns the content stream of the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' This returns the content stream. 
      ''' It is RECOMMENDED that HTTP Range requests are supported on this resource.  
      ''' It is RECOMMENDED that HTTP compression is also supported. 
      ''' Please see RFC2616 for more information on HTTP Range requests.
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetContentStream)>
      Function GetContentStream(repositoryId As String, id As String, streamId As String) As IO.Stream
      ''' <summary>
      ''' Sets the content stream of the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="overwriteFlag"></param>
      ''' <param name="data"></param>
      ''' <remarks>
      ''' Success HTTP code: 
      ''' 200 (with content),  
      ''' 204 (without content) or
      ''' 201 if a new resource is created.  
      ''' Please see the HTTP specification for more information. 
      ''' Content-Location: URI for content stream 
      ''' Location: URI for content stream
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="PUT", UriTemplate:=ServiceURIs.SetContentStream)>
      Sub SetContentStream(repositoryId As String, id As String, overwriteFlag As String, data As IO.Stream)
      ''' <summary>
      ''' Deletes the content stream of the specified object.
      ''' </summary>
      ''' <remarks>Keine weiteren Infos in Standardbeschreibung http://docs.oasis-open.org/cmis/CMIS/v1.0/cmis-spec-v1.0.html </remarks>
      <OperationContract()>
      <WebInvoke(Method:="DELETE", UriTemplate:=ServiceURIs.DeleteContentStream)>
      Sub DeleteContentStream(repositoryId As String, id As String)
#End Region

#Region "ACL Resource"
      ''' <summary>
      ''' Get the ACL currently applied to the specified document or folder object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/cmisacl+xml
      ''' </remarks>
      <OperationContract()>
     <WebGet(UriTemplate:=ServiceURIs.GetAcl)>
      Function GetACL(repositoryId As String, id As String) As Acl
      ''' <summary>
      ''' Adds or removes the given ACEs to or from the ACL of document or folder object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="data"></param>
      ''' <remarks>
      ''' Keine weiteren Infos in Standardbeschreibung http://docs.oasis-open.org/cmis/CMIS/v1.0/cmis-spec-v1.0.html
      ''' </remarks>
      <OperationContract()>
     <WebInvoke(Method:="PUT", UriTemplate:=ServiceURIs.ApplyACL, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function ApplyACL(repositoryId As String, id As String, aclPropagation As String, data As Xml.XmlDocument) As Acl
#End Region

#End Region

#Region "Service Collections"

#Region "Query Collection"
      ''' <summary>
      ''' Returns the data described by the specified CMIS query. (POST Request)
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' Status Codes:
      ''' 201 Success
      ''' Headers returned:
      ''' Location Header
      ''' Content-Location Header
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.QueryBase, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function QueryPost(repositoryId As String, data As Xml.XmlDocument) As Atom10FeedFormatter
#End Region

#Region "Checked Out Collection"
      ''' <summary>
      ''' Returns a list of check out object the user has access to.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="skipCount"></param>
      ''' <param name="renditionFilter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:object inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
    <WebGet(UriTemplate:=ServiceURIs.GetCheckedoutDocs)>
      Function GetCheckedOutDocs(repositoryId As String, id As String, filter As String, maxItems As String, skipCount As String, renditionFilter As String, includeAllowableActions As String, includeRelationships As String) As Atom10FeedFormatter
      ''' <summary>
      ''' Checks out the specified CMIS object.
      ''' </summary>
      ''' <returns></returns>
      ''' <remarks>
      ''' HTTP/1.1 201 Created
      ''' MUST support Atom Entry Documents with CMIS extensions
      ''' application/atom+xml;type=entry or
      ''' application/cmisatom+xml
      ''' </remarks>
      <OperationContract()>
     <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.CheckOut, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function CheckOut(repositoryId As String, data As Xml.XmlDocument) As Atom10ItemFormatter
#End Region

#Region "Unfiled Collection"

      ''' <summary>
      ''' Removes an existing fileable non-folder object from a folder.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' MUST support Atom Entry Documents with CMIS extensions
      ''' application/atom+xml;type=entry or
      ''' application/cmisatom+xml
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:object inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' HTTP Success: 201
      ''' Location Header
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.RemoveObjectFromFolder, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function RemoveObjectFromFolder(repositoryId As String, removeFrom As String, data As Xml.XmlDocument) As Atom10ItemFormatter

      ''' <summary>
      ''' Returns a list of all unfiled documents in the repository
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <returns></returns>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetUnfiled)>
      Function GetUnfiled(repositoryId As String) As Atom10FeedFormatter
#End Region

#Region "Types Children Collection"
      ''' <summary>
      ''' Returns all child types of the specified type.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id">Optional!</param>
      ''' <param name="includePropertyDefinitions"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="skipCount"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:type inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetTypeChildren)>
      Function GetTypeChildren(repositoryId As String, id As String, includePropertyDefinitions As String, maxItems As String, skipCount As String) As Atom10FeedFormatter

#End Region

#End Region

#Region "Collections"

#Region "Folder Children Collection"
      ''' <summary>
      ''' Returns all children of the specified CMIS object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="skipCount"></param>
      ''' <param name="filter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="renditionFilter"></param>
      ''' <param name="orderBy"></param>
      ''' <param name="includePathSegment"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetChildren)>
      Function GetChildren(repositoryId As String, id As String, maxItems As String, skipCount As String, filter As String, includeAllowableActions As String, includeRelationships As String, renditionFilter As String, orderBy As String, includePathSegment As String) As Atom10FeedFormatter

      ''' <summary>
      ''' createDocument
      ''' or createFolder
      ''' or createPolicy
      ''' or moveObject
      ''' or addObjectToFolder
      ''' for the specified CMIS object.
      ''' 
      ''' From http://docs.oasis-open.org/cmis/CMIS/v1.0/errata-01/os/cmis-spec-v1.0-errata-01-os-complete.html#_Toc243905556
      ''' The following arguments MAY be supplied. 
      ''' sourceFolderId: This parameter indicates the folder from which the object shall be moved from to the current specified folder.  This parameter is not allowed for create operations.
      ''' If specified moveObject will be performed.
      ''' If not specified, addObjectToFolder will be performed.
      ''' versioningState: The optional argument versioningState MAY specify additional versioning behavior such as checkIn as major or minor. Please see CMIS Domain Model for more information on this parameter.
      ''' 
      ''' POSTing an Atom Entry document with CMIS markup:
      ''' Adding a document to a folder:
      ''' If the atom entry has a cmis property cmis:objectId that is valid for the repository, the object will be added to the folder. 
      ''' 
      ''' When an object is added to the folder, in repositories that do not support multi-filing it will be removed from the previous folder and the operation treated as move.  If the repository supports multiple folders, it will be added to the new folder. 
      ''' If the optional argument sourceFolderId is specified, then the object will be removed from the folder specified.
      ''' 
      ''' If atom:content is missing from the request, the repository MUST treat the missing atom:content element as an empty atom:content element.
      ''' Example client request:
      ''' 
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="versioningState"></param>
      ''' <param name="data"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' MUST support Atom Entry Documents with CMIS extensions
      ''' HTTP Code:
      ''' 200 OK (Success)
      ''' Location Header
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.CreateOrMoveObject, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function CreateOrMoveObject(repositoryId As String, id As String, sourceFolderId As String, versioningState As String, data As Xml.XmlDocument) As Atom10ItemFormatter
#End Region

#Region "Policies Collection"

      ''' <summary>
      ''' Returns a list of policies applied to the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="filter"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:object inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetAppliedPolicies)>
      Function GetAppliedPolicies(repositoryId As String, id As String, filter As String) As Atom10FeedFormatter
      ''' <summary>
      ''' Applies a policy to the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="data"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' MUST support Atom Entry Documents with CMIS extensions
      ''' application/atom+xml;type=entry or
      ''' application/cmisatom+xml
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.ApplyPolicy, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function ApplyPolicy(repositoryId As String, id As String, data As Xml.XmlDocument) As Atom10itemFormatter

      ''' <summary>
      ''' Removes a policy from the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <remarks></remarks>
      <OperationContract()>
      <WebInvoke(Method:="DELETE", UriTemplate:=ServiceURIs.RemovePolicy)>
      Sub RemovePolicy(repositoryId As String, id As String)

#End Region

#Region "Relationships Collection"
      ''' <summary>
      ''' Returns the relationships for the specified object.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="includeSubRelationshipTypes"></param>
      ''' <param name="relationshipDirection"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="skipCount"></param>
      ''' <param name="filter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' The following CMIS Atom extension element MUST be included inside the atom entries:
      ''' cmisra:object inside atom:entry
      ''' The following CMIS Atom extension element MAY be included inside the atom feed:
      ''' cmisra:numItems
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetObjectRelationships)>
      Function GetObjectRelationships(repositoryId As String, id As String, typeId As String, includeSubRelationshipTypes As String, relationshipDirection As String, maxItems As String, skipCount As String, filter As String, includeAllowableActions As String) As Atom10FeedFormatter
      ''' <summary>
      ''' Creates a relationship.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <param name="data"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' MUST support Atom Entry Documents with CMIS extensions
      ''' application/atom+xml;type=entry or
      ''' application/cmisatom+xml
      ''' </remarks>
      <OperationContract()>
      <WebInvoke(Method:="POST", UriTemplate:=ServiceURIs.CreateRelationship, RequestFormat:=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Bare)>
      Function CreateRelationship(repositoryId As String, id As String, data As Xml.XmlDocument) As Atom10ItemFormatter
#End Region
#End Region

#Region "URI Templates"


#Region "Object By Path"
      ''' <summary>
      ''' Returns the object at the specified path
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="path"></param>
      ''' <param name="filter"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includePolicyIds"></param>
      ''' <param name="includeRelationships"></param>
      ''' <param name="includeACL"></param>
      ''' <param name="renditionFilter"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=entry
      ''' </remarks>
      <OperationContract()>
     <WebGet(UriTemplate:=ServiceURIs.GetObjectByPath)>
      Function GetObjectByPath(repositoryId As String, path As String, filter As String, includeAllowableActions As String, includePolicyIds As String, includeRelationships As String, includeACL As String, renditionFilter As String) As Atom10ItemFormatter

#End Region

#Region "Query"
      ''' <summary>
      ''' Returns the data described by the specified CMIS query. (GET Request)
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="q"></param>
      ''' <param name="searchAllVersions"></param>
      ''' <param name="maxItems"></param>
      ''' <param name="skipCount"></param>
      ''' <param name="includeAllowableActions"></param>
      ''' <param name="includeRelationships"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/atom+xml;type=feed
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.Query)>
      Function QueryGet(repositoryId As String, q As String, searchAllVersions As String, maxItems As String, skipCount As String, includeAllowableActions As String, includeRelationships As String) As Atom10FeedFormatter

#End Region

#End Region


#Region "CMIS Specific Link Relations"
      ''' <summary>
      ''' Returns the allowable actions for the specified document.
      ''' </summary>
      ''' <param name="repositoryId"></param>
      ''' <param name="id"></param>
      ''' <returns></returns>
      ''' <remarks>
      ''' Media Type: application/cmisallowableactions+xml
      ''' </remarks>
      <OperationContract()>
      <WebGet(UriTemplate:=ServiceURIs.GetAllowableActions)>
      Function GetAllowableActions(repositoryId As String, id As String) As AllowableActions

#End Region

   End Interface
End Namespace